package com.example.rwq_test.niuke.heap;

import java.util.Comparator;
import java.util.Objects;

/**
 * TODO note
 *
 * @author renweiqiang
 * @version 1.0.0
 * @createTime 2024/1/2
 */
public class FloorComparator implements Comparator<FloorInfo> {
    @Override
    public int compare(FloorInfo o1, FloorInfo o2) {
        if (Objects.equals(o1.getElevatorId(), o2.getElevatorId())) {
            return o2.getId() - o1.getId();
        }
        return o2.getElevatorId() - o1.getElevatorId();
    }
}
